home *** CD-ROM | disk | FTP | other *** search
-
- #include <exec/types.h>
- #include <exec/memory.h>
- #include <clib/exec_protos.h>
- #include <clib/alib_protos.h>
-
- #include <stdlib.h>
- #include <string.h>
- #include <stdio.h>
- #include <ctype.h>
- #include <time.h>
-
-
- #ifdef __SASC
- int CXBRK(void) { return(0); }
- int _CXBRK(void) { return(0); }
- void chkabort(void) {}
- #endif
-
- #include <HBBS/Defines.h>
- #include <HBBS/types.h>
- #include <HBBS/structures.h>
- #include <HBBS/hbbscommon_protos.h>
- #include <HBBS/hbbscommon_pragmas.h>
-
- struct Library *HBBSCommonBase=NULL;
-
- struct BBSGlobalData *BBSGlobal=NULL;
- struct NodeData *N_ND;
- static VOID cleanup(ULONG num)
- {
- if (HBBSCommonBase)
- {
- HBBS_CleanUpCommon();
- CloseLibrary (HBBSCommonBase);
- }
-
- if (num) printf("Door Error = %d\n",num);
-
- exit(0);
- }
-
- static VOID init(VOID)
- {
- if(!(HBBSCommonBase = OpenLibrary("HBBSCommon.library",0)))
- {
- cleanup(1);
- }
-
- if (!(HBBS_InitCommon()))
- {
- cleanup(2);
- }
-
- }
-
- void PrintList( struct List *list)
- {
- struct Node *node;
- for (node = list->lh_Head ; node->ln_Succ ; node =node->ln_Succ)
- {
- puts(node->ln_Name);
- }
- }
-
- int main(int argc,char *argv[])
- {
- struct CfgFileData *CfgFile=NULL;
-
- init();
-
- if (CfgFile=HBBS_LoadConfig("T:Test.CFG"))
- {
- PrintList(CfgFile->ItemsList);
- HBBS_AddCfgItem(CfgFile,"Item_3","55");
- PrintList(CfgFile->ItemsList);
- HBBS_FlushConfig(CfgFile);
- }
-
- cleanup(0);
- }
-